package com.sqx.modules.coupon.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.coupon.entity.TbCouponUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface TbCouponUserDao extends BaseMapper<TbCouponUser> {

    IPage<TbCouponUser> selectCouponList(Page<TbCouponUser> pages, @Param("userId") Long userId,
                                         @Param("minMoney") BigDecimal minMoney, @Param("format") String format,@Param("shopId") Long shopId);

    IPage<TbCouponUser> CouponList(Page<TbCouponUser> pages,@Param("userId") Long userId,@Param("status") Integer status);

    void updateExpiration();

    IPage<TbCouponUser> selectCouponByUserId(Page<TbCouponUser> pages, @Param("userId") Long userId,
                                             @Param("status") Integer status, @Param("phone") String phone,
                                             @Param("shopName") String shopName,@Param("shopId") Long shopId);

    int selectCountCoupon(Long userId);

    int giveCoupon(List<String> userIdList, @Param("couponName")String couponName, @Param("couponPicture")String couponPicture,
                   @Param("createTime") String createTime, @Param("expirationTime")String expirationTime, @Param("minMoney")BigDecimal minMoney,@Param("goodsType") String goodsType,
                   @Param("money")BigDecimal money, @Param("status")Integer status, @Param("endTime")String endTime,@Param("shopId") Long shopId);

}
